package com.zuthub.system.service.impl;

import java.util.List;
import com.zuthub.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zuthub.system.mapper.SysInformMapper;
import com.zuthub.system.domain.SysInform;
import com.zuthub.system.service.ISysInformService;

/**
 * 通知公告Service业务层处理
 * 
 * @author zuthub
 * @date 2021-04-02
 */
@Service
public class SysInformServiceImpl implements ISysInformService 
{
    @Autowired
    private SysInformMapper sysInformMapper;

    /**
     * 查询通知公告
     * 
     * @param informId 通知公告ID
     * @return 通知公告
     */
    @Override
    public SysInform selectSysInformById(Long informId)
    {
        return sysInformMapper.selectSysInformById(informId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param sysInform 通知公告
     * @return 通知公告
     */
    @Override
    public List<SysInform> selectSysInformList(SysInform sysInform)
    {
        return sysInformMapper.selectSysInformList(sysInform);
    }

    /**
     * 新增通知公告
     * 
     * @param sysInform 通知公告
     * @return 结果
     */
    @Override
    public int insertSysInform(SysInform sysInform)
    {
        sysInform.setCreateTime(DateUtils.getNowDate());
        return sysInformMapper.insertSysInform(sysInform);
    }

    /**
     * 修改通知公告
     * 
     * @param sysInform 通知公告
     * @return 结果
     */
    @Override
    public int updateSysInform(SysInform sysInform)
    {
        sysInform.setUpdateTime(DateUtils.getNowDate());
        return sysInformMapper.updateSysInform(sysInform);
    }

    /**
     * 批量删除通知公告
     * 
     * @param informIds 需要删除的通知公告ID
     * @return 结果
     */
    @Override
    public int deleteSysInformByIds(Long[] informIds)
    {
        return sysInformMapper.deleteSysInformByIds(informIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param informId 通知公告ID
     * @return 结果
     */
    @Override
    public int deleteSysInformById(Long informId)
    {
        return sysInformMapper.deleteSysInformById(informId);
    }
}
